<nav>
	<ul>
		{if $movie->imdbid != ""}
		<li>
			<div class="button">
				<div>
					<a href="http://www.imdb.com/title/tt{$movie->imdbid}/" target="_blank"><img src="{$tpl_include}images/icons/imdb.png" alt="{$smarty.const.VISIT_IMDB|htmlentities:3:'UTF-8'}" title="{$smarty.const.VISIT_IMDB|htmlentities:3:'UTF-8'}"><br/>
					{$smarty.const.VISIT_IMDB}</a>
				</div>
			</div>
		</li>
		{/if}
			
		{if $movie->trailer}
		<li>
			<div class="button">
				<div>
					<a href="{$movie->trailer}{if !$movie->getYouTubeTrailerId()}{if $movie->trailer|strpos:"?" > 0}&{else}?{/if}iframe=true&width=100%&height=100%{/if}" rel="prettyPhoto{if !$movie->getYouTubeTrailerId()}[iframes]{/if}" title="{$movie->name|htmlentities:3:'UTF-8'} ({$movie->year|htmlentities:3:'UTF-8'})">
					<img src="{$tpl_include}images/icons/32x32/movies.png" alt="{$smarty.const.VIEW_TRAILER|htmlentities:3:'UTF-8'}" title="{$smarty.const.VIEW_TRAILER|htmlentities:3:'UTF-8'}"><br/>
					{$smarty.const.VIEW_TRAILER|htmlentities:3:'UTF-8'}</a>
				</div>
			</div>
		</li>
		{/if}
		
		{if $movie->hasCover()}
		<li>
			<div class="button">
				<div>
					<a href="./?go=downloadcover&id={$movie->id}"><img src="{$tpl_include}images/icons/32x32/picture_save.png" alt="{$smarty.const.DOWNLOAD_COVER|htmlentities:3:'UTF-8'}" title="{$smarty.const.DOWNLOAD_COVER|htmlentities:3:'UTF-8'}"><br/>
					{$smarty.const.DOWNLOAD_COVER|htmlentities:3:'UTF-8'}</a>
				</div>
			</div>
		</li>
		{/if}
			
		<li>
			<div class="button">
				<div>
					{if $loggedin && $User->isEditor()}
					<a href="./?go=own&id={$movie->id}&own={if $movie->own}0{else}1{/if}">
					{/if}
					{if $movie->own}
						<img src="{$tpl_include}images/icons/32x32/star.png" alt="{$smarty.const.OWN|htmlentities:3:'UTF-8'}" title="{$smarty.const.OWN|htmlentities:3:'UTF-8'}"><br/>
						{$smarty.const.OWN|htmlentities:3:'UTF-8'}
					{else}
						<img src="{$tpl_include}images/icons/32x32/star_gray.png" alt="{$smarty.const.NOT_OWN|htmlentities:3:'UTF-8'}" title="{$smarty.const.NOT_OWN|htmlentities:3:'UTF-8'}"><br/>
						{$smarty.const.NOT_OWN|htmlentities:3:'UTF-8'}
					{/if}
					{if $loggedin && $User->isEditor()}
					</a>
					{/if}
				</div>
			</div>
		</li>
		
		<li>
			<div class="button">
				<div>
					{if $loggedin && $User->isEditor()}
					<a href="./?go=own&id={$movie->id}&seen={if $movie->seen}0{else}1{/if}">
					{/if}
					{if $movie->seen}
						<img src="{$tpl_include}images/icons/32x32/eye.png" alt="{$smarty.const.SEEN|htmlentities:3:'UTF-8'}" title="{$smarty.const.SEEN|htmlentities:3:'UTF-8'}"><br/>
						{$smarty.const.SEEN|htmlentities:3:'UTF-8'}
					{else}
						<img src="{$tpl_include}images/icons/32x32/eye_gray.png" alt="{$smarty.const.UNSEEN|htmlentities:3:'UTF-8'}" title="{$smarty.const.UNSEEN|htmlentities:3:'UTF-8'}"><br/>
						{$smarty.const.UNSEEN|htmlentities:3:'UTF-8'}
					{/if}
					{if $loggedin && $User->isEditor()}
					</a>
					{/if}
				</div>
			</div>
		</li>
		
		{if $loggedin && $User->isEditor()}
		<li>
			<div class="button">
				<div>
					<a href="./?go=edit&id={$movie->id}"><img src="{$tpl_include}images/icons/32x32/pencil.png" alt="{$smarty.const.EDIT|htmlentities:3:'UTF-8'}" title="{$smarty.const.EDIT|htmlentities:3:'UTF-8'}"><br/>
					{$smarty.const.EDIT|htmlentities:3:'UTF-8'}</a>
				</div>
			</div>
		</li>
		{/if}
			
		{if $loggedin && $User->isEditor()}
		<li>
			<div class="button">
				<div>
					<a href="javascript:void(0);" onclick="if(confirm('{$smarty.const.CONFIRM_REMOVE|htmlentities:3:'UTF-8'}')) location.href='./?go=delete&id={$movie->id}';"><img src="{$tpl_include}images/icons/32x32/delete.png" alt="{$smarty.const.REMOVE|htmlentities:3:'UTF-8'}" title="{$smarty.const.REMOVE|htmlentities:3:'UTF-8'}"><br/>
					{$smarty.const.REMOVE|htmlentities:3:'UTF-8'}</a>
				</div>
			</div>
		</li>
		{/if}
	</ul>
</nav>

<div class="content">
	<div id="movie">
		
		<div class="photo">
			{assign var=photo value=0}
			{if isset($imdbmovie) && $imdbmovie->photo()}
			<img src="{$imdbmovie->photo()}" alt="{$movie->name|htmlentities:3:'UTF-8'}" title="{$movie->name|htmlentities:3:'UTF-8'}">
			{assign var=photo value=1}
			{elseif isset($movie) && $movie->hasPhoto()}
			<img src="{$movie->photo()}" alt="{$movie->name|htmlentities:3:'UTF-8'}" title="{$movie->name|htmlentities:3:'UTF-8'}">
			{assign var=photo value=1}
			{elseif isset($movie) && $movie->hasCover()}
			<img src="{$movie->cover()}" alt="{$movie->name|htmlentities:3:'UTF-8'}" title="{$movie->name|htmlentities:3:'UTF-8'}">
			{assign var=photo value=1}
			{/if}
		
			<div class="taglines">
				{if $movie->taglines && strlen($movie->taglines) > 0}
				{assign var=taglines value=$movie->getList('taglines')}
				{section name=t loop=$taglines max=1}
					<div>{$taglines[t]|htmlentities:3:'UTF-8'}</div>
				{/section}
				{/if}
			</div>
		</div>
		
		<div class="maininfo{if !$photo}_full{/if}">
			<h2>
				{$movie->name|htmlentities:3:'UTF-8'} ({$movie->year|htmlentities:3:'UTF-8'})
			</h2>
		
			<div class="loaned">
			{if $movie->loaned}
				{$smarty.const.LOANED_OUT|htmlentities:3:'UTF-8'}{if $movie->loanname != ""} {$smarty.const.TO|htmlentities:3:'UTF-8'} {$movie->loanname|htmlentities:3:'UTF-8'}{/if}{if $movie->loandate != "0000-00-00"} {$smarty.const.ON|htmlentities:3:'UTF-8'} {$movie->loandate|htmlentities:3:'UTF-8'}{/if}
			{/if}
			</div>
			
			<div class="genre">
				{if $movie->genres && strlen($movie->genres) > 0}
				{assign var=genres value=$movie->getList('genres')}
				{section name=g loop=$genres}
					{if !$smarty.section.g.first}|{/if}
					{$genres[g]|htmlentities:3:'UTF-8'}
				{/section}
				{/if}
			</div>
			
			<div class="duration">
				{$movie->format|htmlentities:3:'UTF-8'}{if $movie->duration && $movie->duration != 0}, {$movie->duration|htmlentities:3:'UTF-8'} {$smarty.const.MINUTES|htmlentities:3:'UTF-8'}{/if}
			</div>
			
			<div class="rating">
				{if $movie->rating && $movie->rating != 0}
				<span class="header">{$smarty.const.RATING|htmlentities:3:'UTF-8'}:</span> 
				{$movie->rating|htmlentities:3:'UTF-8'}
				{/if}
			</div>
			
			<div class="languages">
				{if $movie->languages && strlen($movie->languages) > 0}
				<span class="header">{$smarty.const.LANGUAGES|htmlentities:3:'UTF-8'}:</span>
				{assign var=languages value=$movie->getList('languages')}
				{section name=l loop=$languages}
					{if !$smarty.section.l.first}|{/if}
					{$languages[l]|htmlentities:3:'UTF-8'}
				{/section}
				{/if}
			</div>
			
			<div class="subtitles">
				{if $movie->subtitles && strlen($movie->subtitles) > 0}
				<span class="header">{$smarty.const.SUBTITLES|htmlentities:3:'UTF-8'}:</span>
				{assign var=subtitles value=$movie->getList('subtitles')}
				{section name=s loop=$subtitles}
					{if !$smarty.section.s.first}|{/if}
					{$subtitles[s]|htmlentities:3:'UTF-8'}
				{/section}
				{/if}
			</div>
			
			<div class="country">
				{if $movie->country && strlen($movie->country) > 0}
				<span class="header">{$smarty.const.COUNTRY|htmlentities:3:'UTF-8'}:</span>
				{assign var=country value=$movie->getList('country')}
				{section name=c loop=$country}
					{if !$smarty.section.c.first}|{/if}
					{$country[c]|htmlentities:3:'UTF-8'}
				{/section}
				{/if}
			</div>
			
			<div class="director">
				{if $movie->director && strlen($movie->director) > 0}
				<span class="header">{$smarty.const.DIRECTOR|htmlentities:3:'UTF-8'}:</span>
				{assign var=director value=$movie->getList('director')}
				{section name=d loop=$director}
					{if !$smarty.section.d.first}|{/if}
					{$director[d]|htmlentities:3:'UTF-8'}
				{/section}
				{/if}
			</div>
			
			<div class="writer">
				{if $movie->writer && strlen($movie->writer) > 0}
				<span class="header">{$smarty.const.WRITER|htmlentities:3:'UTF-8'}:</span>
				{assign var=writer value=$movie->getList('writer')}
				{section name=w loop=$writer}
					{if !$smarty.section.w.first}|{/if}
					{$writer[w]|htmlentities:3:'UTF-8'}
				{/section}
				{/if}
			</div>
			
			<div class="producer">
				{if $movie->producer && strlen($movie->producer) > 0}
				<span class="header">{$smarty.const.PRODUCER|htmlentities:3:'UTF-8'}:</span>
				{assign var=producer value=$movie->getList('producer')}
				{section name=p loop=$producer}
					{if !$smarty.section.p.first}|{/if}
					{$producer[p]|htmlentities:3:'UTF-8'}
				{/section}
				{/if}
			</div>
			
			<div class="music">
				{if $movie->music && strlen($movie->music) > 0}
				<span class="header">{$smarty.const.MUSIC|htmlentities:3:'UTF-8'}:</span>
				{assign var=music value=$movie->getList('music')}
				{section name=m loop=$music}
					{if !$smarty.section.m.first}|{/if}
					{$music[m]|htmlentities:3:'UTF-8'}
				{/section}
				{/if}
			</div>
			
			<div class="video">
				{if $movie->video && strlen($movie->video) > 0}
				<span class="header">{$smarty.const.VIDEO|htmlentities:3:'UTF-8'}:</span>
				{assign var=video value=$movie->getList('video')}
				{section name=v loop=$video}
					{if !$smarty.section.v.first}|{/if}
					{$video[v]|htmlentities:3:'UTF-8'}
				{/section}
				{/if}
			</div>
			
			<div class="audio">
				{if $movie->audio && strlen($movie->audio) > 0}
				<span class="header">{$smarty.const.AUDIO|htmlentities:3:'UTF-8'}:</span>
				{assign var=audio value=$movie->getList('audio')}
				{section name=a loop=$audio}
					{if !$smarty.section.a.first}|{/if}
					{$audio[a]|htmlentities:3:'UTF-8'}
				{/section}
				{/if}
			</div>
			
			<div class="notes">
				{if $movie->notes && strlen($movie->notes) > 0}
				<h3>{$smarty.const.PERSONAL_NOTES|htmlentities:3:'UTF-8'}</h3>
				{$movie->notes|htmlentities:3:'UTF-8'|nl2br}
				{/if}
			</div>
			
			<div class="plotoutline">
				{if $movie->plotoutline && strlen($movie->plotoutline) > 0}
				<h3>{$smarty.const.PLOT_OUTLINE|htmlentities:3:'UTF-8'}</h3>
				{assign var=plotoutline value=$movie->getList('plotoutline')}
				{section name=p loop=$plotoutline}
					<div>{$plotoutline[p]|htmlentities:3:'UTF-8'}</div>
				{/section}
				{/if}
			</div>
			
			<div class="cast">
				{if $movie->cast && strlen($movie->cast) > 0}
				<h3>{$smarty.const.CAST|htmlentities:3:'UTF-8'}</h3>
				<div class="castlist">
					<ul>
					{assign var=cast value=$movie->getList('cast')}
					{section name=c loop=$cast}
						<li>{$cast[c]|htmlentities:3:'UTF-8'}</li>
					{/section}
					{/if}
					</ul>
				</div>
			</div>
			
			<div class="plots">
				{if $movie->plots && strlen($movie->plots) > 0}
				<h3>{$smarty.const.PLOTS|htmlentities:3:'UTF-8'}</h3>
				<ol>
					{assign var=plots value=$movie->getList('plots')}
					{section name=p loop=$plots}
						<li>{$plots[p]|htmlentities:3:'UTF-8'}</li>
					{/section}
				</ol>
				{/if}
			</div>
		</div>
		
		<div style="clear: both"></div>
	</div>
</div>

{literal}
<script>
$(document).ready(function() {
	$("a[rel^='prettyPhoto']").prettyPhoto({
		social_tools: '',
		default_width: 800,
		default_height: 550
	});
	$(".castlist").columnize({
		columns: 4
	});
});
</script>
{/literal}